CURRENT_DIR = `pwd`

CXX = g++

CXXFLAGS = -O2 -Wno-deprecated -Wall

BINFOLDER = bin
TESTFOLDER = test

COMPILE = $(CXX) -c $(CXXFLAGS)

PAGE_RANK_TARGET = $(BINFOLDER)/pageRank 	
PAGE_RANK_OBJS = $(BINFOLDER)/PageRank.o $(BINFOLDER)/TimeMeasurement.o $(BINFOLDER)/PageRankMain.o

$(PAGE_RANK_TARGET):	$(PAGE_RANK_OBJS)
	$(CXX) $(PAGE_RANK_OBJS) -o $(PAGE_RANK_TARGET)

$(BINFOLDER)/PageRank.o: PageRank.cpp PageRank.h
	${COMPILE} PageRank.cpp -o $(BINFOLDER)/PageRank.o
$(BINFOLDER)/TimeMeasurement.o: TimeMeasurement.h TimeMeasurement.cpp
	${COMPILE} TimeMeasurement.cpp -o $(BINFOLDER)/TimeMeasurement.o
$(BINFOLDER)/PageRankMain.o: PageRankMain.cpp
	${COMPILE} PageRankMain.cpp -o $(BINFOLDER)/PageRankMain.o

# PageRank
pageRank:	$(PAGE_RANK_TARGET)

# all
all:	$(PAGE_RANK_TARGET)

# clean
clean:
	rm -f $(BINFOLDER)/*
	rm -f $(TESTFOLDER)/output/*

# run
run:	$(PAGE_RANK_TARGET)
	./bin/pageRank -i test/input/links -p test/output/pageRanks

	